#ifndef _PLATFORM_H_
#define _PLATFORM_H_


#include "gd32f30x.h"                   // Device header
#include "common.h"
#include "assert.h"
#include <stddef.h>
#include <string.h>

#define EXTDINUM        ( 16 )/*拓展模块继电器数量*/
#define EXTDICTRLADDR1   ( 0x1 )
#define EXTDICTRLADDR2   ( 0x2 )

#define DIDONUM 32/*开入开出数*/

#define MAX_DIDONUM  (64)/*平台最大开入开出数*/
#define MAX_DIDOINDEX (MAX_DIDONUM-1)

#define disableInterrupts() __set_PRIMASK(1)
#define enableInterrupts()  __set_PRIMASK(0)


/****************************************************************************
 * Public Types
 ****************************************************************************/

//  typedef enum {
//   FALSE = 0, TRUE = !FALSE
//  } bool_t;

typedef enum {FALSE = 0, TRUE = !FALSE} bool;

/* These types are expected to be 64-bit */
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint8_t u8;
/****************************************************************************
 * Public Functions
 ****************************************************************************/

#endif /* _PLATFORM_H_ */
